#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>

typedef long long LL;
const int N = 1e5 + 5;
using namespace std;

int tr[N], n, m;
LL H[N];
void push(int x, int num) {
    for (int i = x; i <= n; i += i & -i) 
        tr[i] += num;
}
void check() {
    
}
signed main() {
    int t;
    scanf("%d", &t);
    while (t --) {
        scanf("%d %d", &n, &m);
        memset(tr, 0, sizeof tr);
        for (int i = 1; i <= n; ++ i) {
            scanf("%lld", H + i);
            H[i] += H[i - 1];
        }
        for (int i = 1; i <= m; ++ i) {
            LL x;
            scanf("%lld", &x);
            if (x == 0) puts("0");
            else {
                
            }
        }
    }
    return 0;
}